class CreateNumbers < ActiveRecord::Migration
  def self.up
    #车次表
    create_table :numbers do |t|
      t.string              :sn                   #车次编号
      t.string              :line                 #行车路线
      t.integer             :length               #一次行驶公里数
      t.timestamps
    end

    Number.create(:sn => "D76",:line => "上海-青岛",:length => 1360)
    Number.create(:sn => "D77",:line => "青岛-上海",:length => 1360)
    Number.create(:sn => "D62",:line => "青岛-北京南",:length => 1660)
    Number.create(:sn => "D61",:line => "北京南-青岛",:length => 1660)
  end

  def self.down
    drop_table :numbers
  end
end
